// Copyright (C) ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
//
// $Id: schedule.hpp 225 2008-09-12 17:43:02Z heavyzheng $
//

#ifndef ZZHENG_QUANT_DATES_SCHEDULE_HPP_20080709__
#define ZZHENG_QUANT_DATES_SCHEDULE_HPP_20080709__

#include <zzheng/quant/dates/config.hpp>
#include <zzheng/quant/dates/date.hpp>
#include <zzheng/quant/dates/adjusted_date.hpp>
#include <zzheng/quant/dates/duration.hpp>
#include <zzheng/quant/dates/rolling.hpp>
#include <zzheng/quant/dates/stub.hpp>
#include <zzheng/quant/dates/calendar.hpp>

#include <vector>

namespace zzheng {
namespace quant {
namespace dates {

    typedef std::pair<adjusted_date, adjusted_date> adjusted_period;

    typedef std::vector<adjusted_period> schedule;

    void generate_schedule(const date& start_date,
                           const date& end_date,
                           const duration& freq,
                           bool end_of_month,
                           stub_t stub,
                           rolling_t rolling,
                           const calendar& cal,
                           schedule& results);

    void generate_schedule(const date& start_date,
                           const duration& maturity,
                           const duration& freq,
                           bool end_of_month,
                           stub_t stub,
                           rolling_t rolling,
                           const calendar& cal,
                           schedule& results);

} // namespace zzheng::quant::dates
} // namespace zzheng::quant
} // namespace zzheng

#endif // ZZHENG_QUANT_DATES_SCHEDULE_HPP_20080709__



